<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

	<p:dialog id="findAdmin" header="#{msgs.FindAdmin}" widgetVar="wfindAdmin" modal="true" style="padding: 0px; margin: 0px;"> 
		<h:form id="findAdminForm" prependId="false">
			<h:panelGrid columns="2" cellpadding="2">

				<h:outputLabel 	value="#{msgs.Name} :" 	for="findByFirstName" />
				<p:inputText	id="findByFirstName" 		value="#{ adminBean.findByFirstName}" 	 	maxlength="20" 	size="20" />


				<h:outputLabel 	value="#{msgs.LastName} :" 	for="findByLastName" />
				<p:inputText	id="findByLastName" 		value="#{ adminBean.findByLastName}" 		maxlength="40" 	size="40" />

				<h:outputLabel	value="#{msgs.Email} :" 			for="findByEmail" />
				<p:inputText id="findByEmail" 				value="#{adminBean.findByEmail}"			maxlength="50" size="51" />

				<h:outputLabel	value="#{ msgs.CreatedAt} :" />
				<h:column>
				<p:calendar		id="begCreatedAt"	value="#{adminBean.begCreatedAt}"		locale="pt"		timeZone="Brazil/East" selectOtherMonths="true" readOnlyInputText="true"  />
                      #{ msgs.To}
                      <p:calendar		id="endCreatedAt"	value="#{adminBean.endCreatedAt}"		locale="pt"		timeZone="Brazil/East" selectOtherMonths="true"	readOnlyInputText="true" />
				</h:column>


				<h:outputLabel	value="#{ msgs.ChangedAt} :" />
				<h:column>
				<p:calendar		id="begChangedAt"	value="#{adminBean.begChangedAt}"		locale="pt"		timeZone="Brazil/East" selectOtherMonths="true" readOnlyInputText="true"  />
                      #{ msgs.To}
                      <p:calendar		id="endChangedAt"	value="#{adminBean.endChangedAt}"		locale="pt"		timeZone="Brazil/East" selectOtherMonths="true"	readOnlyInputText="true" />
				</h:column>

				<h:outputLabel value="#{ msgs.Status}  :" />
				<p:selectOneRadio value="#{ adminBean.findByStatus}">
					<f:selectItem itemLabel="#{ msgs.Active}" 		itemValue="true" />
					<f:selectItem itemLabel="#{ msgs.Inactive}" 	itemValue="false" />
				</p:selectOneRadio>

			</h:panelGrid>
			<p:commandButton value="#{ msgs.Search}"	actionListener="#{adminBean.search}"	icon=" ui-icon-search"  process="@form" update=":listAdminForm:adminsTable,:growl" oncomplete="wfindAdmin.hide()" />
			<p:commandButton value="#{ msgs.Clear}"		type="button"	icon="ui-icon-clean">
				 <p:ajax update="findAdminForm" resetValues="true" />  	
			</p:commandButton>
		</h:form>
	</p:dialog>

	<p:dialog id="dlgupload" header="#{msgs.Upload}" widgetVar="wdlgupload" modal="true" dynamic="true" style="min-width:500px;padding: 0px; margin: 0px;">
		<h:form  prependId="false" enctype="multipart/form-data">
				<p:fileUpload fileUploadListener="#{adminBean.uploadPhoto}" 
				mode="advanced" 
				styleClass="mobupload"
	            allowTypes="/(\.|\/)(jpg|jpeg)$/"
				sizeLimit="1073741824" 
				cancelLabel="#{msgs.Cancel}"
				label="#{msgs.SelectThePhoto}"
				uploadLabel="#{msgs.Upload}"
				oncomplete="dlgUpload.hide()"
				auto="true"
				invalidFileMessage="#{msgs.InvalidPhotoFormat}"
				update=":growl,:tabUser:formAdminData:photoAdmin" />
				<br/>
		</h:form>
	</p:dialog>

	<p:dialog id="dlguploadVideo" header="#{msgs.Upload}" widgetVar="wdlguploadVideo" modal="true" dynamic="true" style="min-width:500px;padding: 0px; margin: 0px;">
		<h:form  prependId="false" enctype="multipart/form-data">
				<p:fileUpload fileUploadListener="#{adminBean.uploadVideo}" 
				mode="advanced" 
				styleClass="mobupload"
	            allowTypes="/(\.|\/)(avi|mp4|mov)$/"
				sizeLimit="1073741824" 
				cancelLabel="#{msgs.Cancel}"
				label="#{msgs.SelectTheVideo}"
				uploadLabel="#{msgs.Upload}"
				oncomplete="wdlguploadVideo.hide();syncrs();"
				auto="true"
				invalidFileMessage="#{msgs.InvalidVideoFormat}"
				update=":growl" />
				<br/>

		</h:form>
	</p:dialog>

	<p:dialog id="progressDialog" header="#{msgs.Upload}" widgetVar="wprogressDialog" onShow="pbAjax.start();"  modal="true"  appendTo="@(body)" closable="false" >
		<h:form prependId="false"> 
			<h:outputText value="#{msgs.SyncWithRemoteStorage}"/>
			<br/>
		    <p:progressBar  widgetVar="pbAjax"  ajax="true" value="#{adminBean.videoUploadProgress}"  styleClass="animated"  labelTemplate="{value}%" global="false"   />
		</h:form>
	</p:dialog>

	<p:confirmDialog message="#{msgs.DoYouReallyWantToDeleteThisEntry}"	header="#{msgs.Warning}" severity="alert" widgetVar="wconfExcAdmin">
		<h:form prependId="false">
			<p:commandButton value="#{msgs.Yes}" oncomplete="wconfExcAdmin.hide();"	process="@form" actionListener="#{adminBean.deleteAdmin}"
				update=":listAdminForm:adminsTable, :growl, :content"  />
			<p:commandButton value="#{msgs.No}" onclick="wconfExcAdmin.hide();"	type="button" />
		</h:form>
	</p:confirmDialog>	 
	
	<p:confirmDialog message="#{msgs.DoYouReallyWantToDeleteThisEntry}"	header="#{msgs.Warning}" severity="alert" widgetVar="wconfExcAdmin">
		<h:form prependId="false">
			<p:commandButton value="#{msgs.Yes}" oncomplete="wconfExcAdmin.hide();"	process="@form" actionListener="#{adminBean.deleteAdmin}"
				update=":listAdminForm:adminsTable, :growl, :content"  />
			<p:commandButton value="#{msgs.No}" onclick="wconfExcAdmin.hide();"	type="button" />
		</h:form>
	</p:confirmDialog>	 
	
	
</html>
		